﻿
namespace NetROS.Tiers.Windows.Forms
{
	/// <summary>
	/// abstract PutniNalog typed datagridview
	/// </summary>
	[System.ComponentModel.DesignerCategoryAttribute("code")]
	public abstract class PutniNalogDataGridViewBase : System.Windows.Forms.UserControl
	{	
		/// <summary> 
		/// Thrown when the current Entity changed.
		/// </summary>
		public event System.EventHandler<PutniNalogDataGridViewEventArgs> CurrentEntityChanged;
		
		#region Fields
				
		/// <summary> 
		/// the current entity.
		/// </summary>
		private Entities.PutniNalog _currentPutniNalog = null;
		//private Dictionary<string, string> _columnsHeaders = new Dictionary<string, string>();
		
		/// <summary> 
		/// the datagridview instance
		/// </summary>
		protected System.Windows.Forms.DataGridView uxPutniNalogDataGridView;
		
		/// <summary> 
		/// the errorprovider
		/// </summary>
		protected System.Windows.Forms.ErrorProvider uxPutniNalogErrorProvider;
		
		/// <summary> 
		/// the bindingsource
		/// </summary>
		protected System.Windows.Forms.BindingSource uxPutniNalogBindingSource;
		
		
		/// <summary> 
		/// the DGV column associated with the ID property
		/// </summary>
		protected System.Windows.Forms.DataGridViewTextBoxColumn uxIDDataGridViewColumn;
		
		/// <summary> 
		/// the DGV column associated with the Oznaka property
		/// </summary>
		protected System.Windows.Forms.DataGridViewTextBoxColumn uxOznakaDataGridViewColumn;
		/// <summary> 
		/// the DGV column associated with the IDDjelatnik property
		/// </summary>
		protected System.Windows.Forms.DataGridViewComboBoxColumn uxIDDjelatnikDataGridViewColumn;
		
		/// <summary> 
		/// the DGV column associated with the Datum property
		/// </summary>
		protected System.Windows.Forms.DataGridViewTextBoxColumn uxDatumDataGridViewColumn;
		
		/// <summary> 
		/// the DGV column associated with the DatumObracuna property
		/// </summary>
		protected System.Windows.Forms.DataGridViewTextBoxColumn uxDatumObracunaDataGridViewColumn;
		
		/// <summary> 
		/// the DGV column associated with the Opis property
		/// </summary>
		protected System.Windows.Forms.DataGridViewTextBoxColumn uxOpisDataGridViewColumn;
		
		/// <summary> 
		/// the DGV column associated with the IDStatus property
		/// </summary>
		protected System.Windows.Forms.DataGridViewTextBoxColumn uxIDStatusDataGridViewColumn;
		/// <summary> 
		/// the DGV column associated with the IDBlagajnaStavkaIsplata property
		/// </summary>
		protected System.Windows.Forms.DataGridViewComboBoxColumn uxIDBlagajnaStavkaIsplataDataGridViewColumn;
		
		/// <summary> 
		/// the DGV column associated with the IDBlagajnaStavkaStorno property
		/// </summary>
		protected System.Windows.Forms.DataGridViewTextBoxColumn uxIDBlagajnaStavkaStornoDataGridViewColumn;
		
		/// <summary> 
		/// the DGV column associated with the PredvidenoTrajanje property
		/// </summary>
		protected System.Windows.Forms.DataGridViewTextBoxColumn uxPredvidenoTrajanjeDataGridViewColumn;
		
		/// <summary> 
		/// the DGV column associated with the PredvidenoTrajanjeDana property
		/// </summary>
		protected System.Windows.Forms.DataGridViewTextBoxColumn uxPredvidenoTrajanjeDanaDataGridViewColumn;
		
		/// <summary> 
		/// the DGV column associated with the Napomena property
		/// </summary>
		protected System.Windows.Forms.DataGridViewTextBoxColumn uxNapomenaDataGridViewColumn;
		
		/// <summary> 
		/// the DGV column associated with the IDDjelatnikOdobrio property
		/// </summary>
		protected System.Windows.Forms.DataGridViewTextBoxColumn uxIDDjelatnikOdobrioDataGridViewColumn;
		
		/// <summary> 
		/// the DGV column associated with the IzvjestajPutovanja property
		/// </summary>
		protected System.Windows.Forms.DataGridViewTextBoxColumn uxIzvjestajPutovanjaDataGridViewColumn;
		
		/// <summary> 
		/// the DGV column associated with the IDDjelatnikLikvidirao property
		/// </summary>
		protected System.Windows.Forms.DataGridViewTextBoxColumn uxIDDjelatnikLikvidiraoDataGridViewColumn;
		
		/// <summary> 
		/// the DGV column associated with the IDDjelatnikBlagajna property
		/// </summary>
		protected System.Windows.Forms.DataGridViewTextBoxColumn uxIDDjelatnikBlagajnaDataGridViewColumn;
		
		/// <summary> 
		/// the DGV column associated with the RedBr property
		/// </summary>
		protected System.Windows.Forms.DataGridViewTextBoxColumn uxRedBrDataGridViewColumn;
		
		#endregion
					
		#region Combo list
		
				
		private Entities.TList<Entities.BlagajnaStavka> _IDBlagajnaStavkaIsplataList;
		
		/// <summary> 
		/// The list of selectable BlagajnaStavka
		/// </summary>
		[System.ComponentModel.Category("DropDownList BindingSources")]
		public Entities.TList<Entities.BlagajnaStavka> IDBlagajnaStavkaIsplataList
		{
			get {return this._IDBlagajnaStavkaIsplataList;}
			set 
			{
				this._IDBlagajnaStavkaIsplataList = value;
				this.uxIDBlagajnaStavkaIsplataDataGridViewColumn.DataSource = null;
				this.uxIDBlagajnaStavkaIsplataDataGridViewColumn.DataSource = this._IDBlagajnaStavkaIsplataList;
			}
		}
		
		private bool _allowNewItemInIDBlagajnaStavkaIsplataList;
		
		/// <summary> 
		/// Indicates if user can add an item in the list of BlagajnaStavka
		/// </summary>
		[System.ComponentModel.Category(".netTiers"), System.ComponentModel.Description("Indicates if end user can add a new item in the combobox. an event will be thrown then.")]
		public bool AllowNewItemInIDBlagajnaStavkaIsplataList
		{
			get { return _allowNewItemInIDBlagajnaStavkaIsplataList;}
			set
			{
				this._allowNewItemInIDBlagajnaStavkaIsplataList = value;
				this.uxIDBlagajnaStavkaIsplataDataGridViewColumn.DisplayStyle = value ? System.Windows.Forms.DataGridViewComboBoxDisplayStyle.ComboBox : System.Windows.Forms.DataGridViewComboBoxDisplayStyle.DropDownButton;
			}
		}
		
				
		private Entities.TList<Entities.Osoba> _IDDjelatnikList;
		
		/// <summary> 
		/// The list of selectable Osoba
		/// </summary>
		[System.ComponentModel.Category("DropDownList BindingSources")]
		public Entities.TList<Entities.Osoba> IDDjelatnikList
		{
			get {return this._IDDjelatnikList;}
			set 
			{
				this._IDDjelatnikList = value;
				this.uxIDDjelatnikDataGridViewColumn.DataSource = null;
				this.uxIDDjelatnikDataGridViewColumn.DataSource = this._IDDjelatnikList;
			}
		}
		
		private bool _allowNewItemInIDDjelatnikList;
		
		/// <summary> 
		/// Indicates if user can add an item in the list of Osoba
		/// </summary>
		[System.ComponentModel.Category(".netTiers"), System.ComponentModel.Description("Indicates if end user can add a new item in the combobox. an event will be thrown then.")]
		public bool AllowNewItemInIDDjelatnikList
		{
			get { return _allowNewItemInIDDjelatnikList;}
			set
			{
				this._allowNewItemInIDDjelatnikList = value;
				this.uxIDDjelatnikDataGridViewColumn.DisplayStyle = value ? System.Windows.Forms.DataGridViewComboBoxDisplayStyle.ComboBox : System.Windows.Forms.DataGridViewComboBoxDisplayStyle.DropDownButton;
			}
		}
		
		#endregion
		
		#region Main Datasource
		
		private Entities.TList<Entities.PutniNalog> _PutniNalogList;
				
		/// <summary> 
		/// The list of PutniNalog to be displayed in the DGV.
		/// </summary>
		[System.ComponentModel.Category("Data")]
		public Entities.TList<Entities.PutniNalog> PutniNalogList
		{
			get {return this._PutniNalogList;}
			set
			{
				this._PutniNalogList = value;
				this.uxPutniNalogBindingSource.DataSource = null;
				this.uxPutniNalogBindingSource.DataSource = value;
				this.uxPutniNalogDataGridView.DataSource = null;
				this.uxPutniNalogDataGridView.DataSource = this.uxPutniNalogBindingSource;				
				//this.uxPutniNalogBindingSource.ListChanged += new System.ComponentModel.ListChangedEventHandler(uxPutniNalogBindingSource_ListChanged);
				this.uxPutniNalogBindingSource.CurrentItemChanged += new System.EventHandler(OnPutniNalogBindingSourceCurrentItemChanged);
			}
		}
		
		private void OnPutniNalogBindingSourceCurrentItemChanged(object sender, System.EventArgs e)
		{
			_currentPutniNalog = uxPutniNalogBindingSource.Current as Entities.PutniNalog;
			
			if (_currentPutniNalog != null)
			{
				_currentPutniNalog.Validate();
			}
			//_PutniNalog.Validate();
			OnCurrentEntityChanged();
		}

		//void uxPutniNalogBindingSource_ListChanged(object sender, System.ComponentModel.ListChangedEventArgs e)
		//{
			//throw new Exception("The method or operation is not implemented.");
		//}		
		
		#endregion
		
		/// <summary>
		/// Gets the currently selected <c cref="Entities.PutniNalog"/> instance.
		/// </summary>
		public Entities.PutniNalog SelectedPutniNalog
		{
			get {return this._currentPutniNalog;}
		}
		
		#region other properties
		
		/// <summary>
		/// Gets or sets a value indicating whether you have provided your own data-management operations for the DataGridView control.
		/// </summary>
		[System.ComponentModel.Category(".netTiers")]
		public bool VirtualMode
		{
			get {return this.uxPutniNalogDataGridView.VirtualMode;}
			set
			{
				this.uxPutniNalogDataGridView.VirtualMode = value;
			}
		}
		
		/// <summary>
		/// Gets or sets a value indicating whether the option to add rows is displayed to the user.
		/// </summary>
		[System.ComponentModel.Category(".netTiers")]
		public bool AllowUserToAddRows
		{
			get {return this.uxPutniNalogDataGridView.AllowUserToAddRows;}
			set {this.uxPutniNalogDataGridView.AllowUserToAddRows = value;}
		}
		
		/// <summary>
		/// Gets or sets a value indicating whether the user is allowed to delete rows from the DataGridView.
		/// </summary>
		[System.ComponentModel.Category(".netTiers")]
		public bool AllowUserToDeleteRows
		{
			get {return this.uxPutniNalogDataGridView.AllowUserToDeleteRows;}
			set {this.uxPutniNalogDataGridView.AllowUserToDeleteRows = value;}
		}
		
		/// <summary>
		/// Gets the <c cref="DataGridView"/> instance.
		/// </summary>
		[System.ComponentModel.Category(".netTiers")]
		public System.Windows.Forms.DataGridView DataGridView
		{
			get {return this.uxPutniNalogDataGridView;}
		}
		
		/// <summary>
		/// Gets a collection that contains all the columns in the control.
		/// </summary>
		[System.ComponentModel.Category(".netTiers")]		
		[System.ComponentModel.DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Visible)]
		//[System.ComponentModel.EditorAttribute("System.Windows.Forms.Design.DataGridViewColumnCollectionEditor, System.Design", typeof(System.Drawing.Design.UITypeEditor))] 
		public System.Windows.Forms.DataGridViewColumnCollection Columns
		{
			get { return this.uxPutniNalogDataGridView.Columns; }
		}
		
		#endregion
		
		/// <summary> 
		/// Required designer variable.
		/// </summary>
		private System.ComponentModel.IContainer components = null;
	
		/// <summary> 
		/// Clean up any resources being used.
		/// </summary>
		/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
		protected override void Dispose(bool disposing)
		{
			if (disposing && (components != null))
			{
				components.Dispose();
			}
			base.Dispose(disposing);
		}
	
		#region Constructor
	
		/// <summary>
		/// Initializes a new instance of the <see cref="PutniNalogDataGridViewBase"/> class.
		/// </summary>
		public PutniNalogDataGridViewBase()
		{			
			this.components = new System.ComponentModel.Container();			
			
			this.uxPutniNalogDataGridView = new System.Windows.Forms.DataGridView();
			this.uxPutniNalogBindingSource = new System.Windows.Forms.BindingSource(this.components);
			this.uxPutniNalogErrorProvider = new System.Windows.Forms.ErrorProvider(this.components);
			this.uxIDDataGridViewColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			this.uxOznakaDataGridViewColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			this.uxIDDjelatnikDataGridViewColumn = new System.Windows.Forms.DataGridViewComboBoxColumn();
			this.uxDatumDataGridViewColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			this.uxDatumObracunaDataGridViewColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			this.uxOpisDataGridViewColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			this.uxIDStatusDataGridViewColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			this.uxIDBlagajnaStavkaIsplataDataGridViewColumn = new System.Windows.Forms.DataGridViewComboBoxColumn();
			this.uxIDBlagajnaStavkaStornoDataGridViewColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			this.uxPredvidenoTrajanjeDataGridViewColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			this.uxPredvidenoTrajanjeDanaDataGridViewColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			this.uxNapomenaDataGridViewColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			this.uxIDDjelatnikOdobrioDataGridViewColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			this.uxIzvjestajPutovanjaDataGridViewColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			this.uxIDDjelatnikLikvidiraoDataGridViewColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			this.uxIDDjelatnikBlagajnaDataGridViewColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			this.uxRedBrDataGridViewColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			//this.uxIDBlagajnaStavkaIsplataBindingSource = new BlagajnaStavkaBindingSource(this.components);
			//((System.ComponentModel.ISupportInitialize)(this.uxIDBlagajnaStavkaIsplataBindingSource)).BeginInit();
			//this.uxIDDjelatnikBindingSource = new OsobaBindingSource(this.components);
			//((System.ComponentModel.ISupportInitialize)(this.uxIDDjelatnikBindingSource)).BeginInit();
			((System.ComponentModel.ISupportInitialize)(this.uxPutniNalogDataGridView)).BeginInit();
			((System.ComponentModel.ISupportInitialize)(this.uxPutniNalogBindingSource)).BeginInit();
			((System.ComponentModel.ISupportInitialize)(this.uxPutniNalogErrorProvider)).BeginInit();
			this.SuspendLayout();
						
			// 
			// uxPutniNalogErrorProvider
			// 
			this.uxPutniNalogErrorProvider.ContainerControl = this;
			this.uxPutniNalogErrorProvider.DataSource = this.uxPutniNalogBindingSource;						
			// 
			// uxPutniNalogDataGridView
			// 
			this.uxPutniNalogDataGridView.AutoGenerateColumns = false;
			this.uxPutniNalogDataGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
			this.uxPutniNalogDataGridView.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
		this.uxIDDataGridViewColumn,
		this.uxOznakaDataGridViewColumn,
		this.uxIDDjelatnikDataGridViewColumn,
		this.uxDatumDataGridViewColumn,
		this.uxDatumObracunaDataGridViewColumn,
		this.uxOpisDataGridViewColumn,
		this.uxIDStatusDataGridViewColumn,
		this.uxIDBlagajnaStavkaIsplataDataGridViewColumn,
		this.uxIDBlagajnaStavkaStornoDataGridViewColumn,
		this.uxPredvidenoTrajanjeDataGridViewColumn,
		this.uxPredvidenoTrajanjeDanaDataGridViewColumn,
		this.uxNapomenaDataGridViewColumn,
		this.uxIDDjelatnikOdobrioDataGridViewColumn,
		this.uxIzvjestajPutovanjaDataGridViewColumn,
		this.uxIDDjelatnikLikvidiraoDataGridViewColumn,
		this.uxIDDjelatnikBlagajnaDataGridViewColumn,
		this.uxRedBrDataGridViewColumn			});
			this.uxPutniNalogDataGridView.Dock = System.Windows.Forms.DockStyle.Fill;
			this.uxPutniNalogDataGridView.Location = new System.Drawing.Point(0, 0);
			this.uxPutniNalogDataGridView.Name = "uxPutniNalogDataGridView";
			this.uxPutniNalogDataGridView.Size = new System.Drawing.Size(470, 300);
			this.uxPutniNalogDataGridView.TabIndex = 0;	
			this.uxPutniNalogDataGridView.BackgroundColor = System.Drawing.Color.WhiteSmoke;
			this.uxPutniNalogDataGridView.EnableHeadersVisualStyles = false;
			this.uxPutniNalogDataGridView.DataError += new System.Windows.Forms.DataGridViewDataErrorEventHandler(this.OnPutniNalogDataGridViewDataError);
			this.uxPutniNalogDataGridView.CellValueNeeded += new System.Windows.Forms.DataGridViewCellValueEventHandler(this.OnPutniNalogDataGridViewCellValueNeeded);
			this.uxPutniNalogDataGridView.CellValuePushed += new System.Windows.Forms.DataGridViewCellValueEventHandler(this.OnPutniNalogDataGridViewCellValuePushed);
			
			//
			// uxIDDataGridViewColumn
			//
			this.uxIDDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxIDDataGridViewColumn.DataPropertyName = "ID";
			this.uxIDDataGridViewColumn.HeaderText = "ID";
			this.uxIDDataGridViewColumn.Name = "uxIDDataGridViewColumn";
			this.uxIDDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxIDDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxIDDataGridViewColumn.ReadOnly = true;		
			//
			// uxOznakaDataGridViewColumn
			//
			this.uxOznakaDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxOznakaDataGridViewColumn.DataPropertyName = "Oznaka";
			this.uxOznakaDataGridViewColumn.HeaderText = "Oznaka";
			this.uxOznakaDataGridViewColumn.Name = "uxOznakaDataGridViewColumn";
			this.uxOznakaDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxOznakaDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxOznakaDataGridViewColumn.ReadOnly = false;		
			//
			// uxIDDjelatnikDataGridViewColumn
			//
			this.uxIDDjelatnikDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxIDDjelatnikDataGridViewColumn.DataPropertyName = "IDDjelatnik";
			this.uxIDDjelatnikDataGridViewColumn.HeaderText = "IDDjelatnik";
			this.uxIDDjelatnikDataGridViewColumn.Name = "uxIDDjelatnikDataGridViewColumn";
			this.uxIDDjelatnikDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxIDDjelatnikDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxIDDjelatnikDataGridViewColumn.ReadOnly = false;		
			//
			// uxDatumDataGridViewColumn
			//
			this.uxDatumDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxDatumDataGridViewColumn.DataPropertyName = "Datum";
			this.uxDatumDataGridViewColumn.HeaderText = "Datum";
			this.uxDatumDataGridViewColumn.Name = "uxDatumDataGridViewColumn";
			this.uxDatumDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxDatumDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxDatumDataGridViewColumn.ReadOnly = false;		
			//
			// uxDatumObracunaDataGridViewColumn
			//
			this.uxDatumObracunaDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxDatumObracunaDataGridViewColumn.DataPropertyName = "DatumObracuna";
			this.uxDatumObracunaDataGridViewColumn.HeaderText = "DatumObracuna";
			this.uxDatumObracunaDataGridViewColumn.Name = "uxDatumObracunaDataGridViewColumn";
			this.uxDatumObracunaDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxDatumObracunaDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxDatumObracunaDataGridViewColumn.ReadOnly = false;		
			//
			// uxOpisDataGridViewColumn
			//
			this.uxOpisDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxOpisDataGridViewColumn.DataPropertyName = "Opis";
			this.uxOpisDataGridViewColumn.HeaderText = "Opis";
			this.uxOpisDataGridViewColumn.Name = "uxOpisDataGridViewColumn";
			this.uxOpisDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxOpisDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxOpisDataGridViewColumn.ReadOnly = false;		
			//
			// uxIDStatusDataGridViewColumn
			//
			this.uxIDStatusDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxIDStatusDataGridViewColumn.DataPropertyName = "IDStatus";
			this.uxIDStatusDataGridViewColumn.HeaderText = "IDStatus";
			this.uxIDStatusDataGridViewColumn.Name = "uxIDStatusDataGridViewColumn";
			this.uxIDStatusDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxIDStatusDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxIDStatusDataGridViewColumn.ReadOnly = false;		
			//
			// uxIDBlagajnaStavkaIsplataDataGridViewColumn
			//
			this.uxIDBlagajnaStavkaIsplataDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxIDBlagajnaStavkaIsplataDataGridViewColumn.DataPropertyName = "IDBlagajnaStavkaIsplata";
			this.uxIDBlagajnaStavkaIsplataDataGridViewColumn.HeaderText = "IDBlagajnaStavkaIsplata";
			this.uxIDBlagajnaStavkaIsplataDataGridViewColumn.Name = "uxIDBlagajnaStavkaIsplataDataGridViewColumn";
			this.uxIDBlagajnaStavkaIsplataDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxIDBlagajnaStavkaIsplataDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxIDBlagajnaStavkaIsplataDataGridViewColumn.ReadOnly = false;		
			//
			// uxIDBlagajnaStavkaStornoDataGridViewColumn
			//
			this.uxIDBlagajnaStavkaStornoDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxIDBlagajnaStavkaStornoDataGridViewColumn.DataPropertyName = "IDBlagajnaStavkaStorno";
			this.uxIDBlagajnaStavkaStornoDataGridViewColumn.HeaderText = "IDBlagajnaStavkaStorno";
			this.uxIDBlagajnaStavkaStornoDataGridViewColumn.Name = "uxIDBlagajnaStavkaStornoDataGridViewColumn";
			this.uxIDBlagajnaStavkaStornoDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxIDBlagajnaStavkaStornoDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxIDBlagajnaStavkaStornoDataGridViewColumn.ReadOnly = false;		
			//
			// uxPredvidenoTrajanjeDataGridViewColumn
			//
			this.uxPredvidenoTrajanjeDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxPredvidenoTrajanjeDataGridViewColumn.DataPropertyName = "PredvidenoTrajanje";
			this.uxPredvidenoTrajanjeDataGridViewColumn.HeaderText = "PredvidenoTrajanje";
			this.uxPredvidenoTrajanjeDataGridViewColumn.Name = "uxPredvidenoTrajanjeDataGridViewColumn";
			this.uxPredvidenoTrajanjeDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxPredvidenoTrajanjeDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxPredvidenoTrajanjeDataGridViewColumn.ReadOnly = false;		
			//
			// uxPredvidenoTrajanjeDanaDataGridViewColumn
			//
			this.uxPredvidenoTrajanjeDanaDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxPredvidenoTrajanjeDanaDataGridViewColumn.DataPropertyName = "PredvidenoTrajanjeDana";
			this.uxPredvidenoTrajanjeDanaDataGridViewColumn.HeaderText = "PredvidenoTrajanjeDana";
			this.uxPredvidenoTrajanjeDanaDataGridViewColumn.Name = "uxPredvidenoTrajanjeDanaDataGridViewColumn";
			this.uxPredvidenoTrajanjeDanaDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxPredvidenoTrajanjeDanaDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxPredvidenoTrajanjeDanaDataGridViewColumn.ReadOnly = false;		
			//
			// uxNapomenaDataGridViewColumn
			//
			this.uxNapomenaDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxNapomenaDataGridViewColumn.DataPropertyName = "Napomena";
			this.uxNapomenaDataGridViewColumn.HeaderText = "Napomena";
			this.uxNapomenaDataGridViewColumn.Name = "uxNapomenaDataGridViewColumn";
			this.uxNapomenaDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxNapomenaDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxNapomenaDataGridViewColumn.ReadOnly = false;		
			//
			// uxIDDjelatnikOdobrioDataGridViewColumn
			//
			this.uxIDDjelatnikOdobrioDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxIDDjelatnikOdobrioDataGridViewColumn.DataPropertyName = "IDDjelatnikOdobrio";
			this.uxIDDjelatnikOdobrioDataGridViewColumn.HeaderText = "IDDjelatnikOdobrio";
			this.uxIDDjelatnikOdobrioDataGridViewColumn.Name = "uxIDDjelatnikOdobrioDataGridViewColumn";
			this.uxIDDjelatnikOdobrioDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxIDDjelatnikOdobrioDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxIDDjelatnikOdobrioDataGridViewColumn.ReadOnly = false;		
			//
			// uxIzvjestajPutovanjaDataGridViewColumn
			//
			this.uxIzvjestajPutovanjaDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxIzvjestajPutovanjaDataGridViewColumn.DataPropertyName = "IzvjestajPutovanja";
			this.uxIzvjestajPutovanjaDataGridViewColumn.HeaderText = "IzvjestajPutovanja";
			this.uxIzvjestajPutovanjaDataGridViewColumn.Name = "uxIzvjestajPutovanjaDataGridViewColumn";
			this.uxIzvjestajPutovanjaDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxIzvjestajPutovanjaDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxIzvjestajPutovanjaDataGridViewColumn.ReadOnly = false;		
			//
			// uxIDDjelatnikLikvidiraoDataGridViewColumn
			//
			this.uxIDDjelatnikLikvidiraoDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxIDDjelatnikLikvidiraoDataGridViewColumn.DataPropertyName = "IDDjelatnikLikvidirao";
			this.uxIDDjelatnikLikvidiraoDataGridViewColumn.HeaderText = "IDDjelatnikLikvidirao";
			this.uxIDDjelatnikLikvidiraoDataGridViewColumn.Name = "uxIDDjelatnikLikvidiraoDataGridViewColumn";
			this.uxIDDjelatnikLikvidiraoDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxIDDjelatnikLikvidiraoDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxIDDjelatnikLikvidiraoDataGridViewColumn.ReadOnly = false;		
			//
			// uxIDDjelatnikBlagajnaDataGridViewColumn
			//
			this.uxIDDjelatnikBlagajnaDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxIDDjelatnikBlagajnaDataGridViewColumn.DataPropertyName = "IDDjelatnikBlagajna";
			this.uxIDDjelatnikBlagajnaDataGridViewColumn.HeaderText = "IDDjelatnikBlagajna";
			this.uxIDDjelatnikBlagajnaDataGridViewColumn.Name = "uxIDDjelatnikBlagajnaDataGridViewColumn";
			this.uxIDDjelatnikBlagajnaDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxIDDjelatnikBlagajnaDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxIDDjelatnikBlagajnaDataGridViewColumn.ReadOnly = false;		
			//
			// uxRedBrDataGridViewColumn
			//
			this.uxRedBrDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxRedBrDataGridViewColumn.DataPropertyName = "RedBr";
			this.uxRedBrDataGridViewColumn.HeaderText = "RedBr";
			this.uxRedBrDataGridViewColumn.Name = "uxRedBrDataGridViewColumn";
			this.uxRedBrDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxRedBrDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxRedBrDataGridViewColumn.ReadOnly = false;		
			//
			// uxIDBlagajnaStavkaIsplataDataGridViewColumn
			//				
			this.uxIDBlagajnaStavkaIsplataDataGridViewColumn.DisplayMember = "IDBlagajnaIzvjestaj";	
			this.uxIDBlagajnaStavkaIsplataDataGridViewColumn.ValueMember = "ID";	
			this.uxIDBlagajnaStavkaIsplataDataGridViewColumn.DisplayStyleForCurrentCellOnly = true;
			//uxIDBlagajnaStavkaIsplataDataGridViewColumn.DataSource = uxIDBlagajnaStavkaIsplataBindingSource;				
				
			//
			// uxIDDjelatnikDataGridViewColumn
			//				
			this.uxIDDjelatnikDataGridViewColumn.DisplayMember = "Ime";	
			this.uxIDDjelatnikDataGridViewColumn.ValueMember = "ID";	
			this.uxIDDjelatnikDataGridViewColumn.DisplayStyleForCurrentCellOnly = true;
			//uxIDDjelatnikDataGridViewColumn.DataSource = uxIDDjelatnikBindingSource;				
				
			
			// this
			this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
			this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
			this.Controls.Add(this.uxPutniNalogDataGridView);
			this.Name = "PutniNalogDataGridView";
			this.Size = new System.Drawing.Size(470, 300);
			//((System.ComponentModel.ISupportInitialize)(this.uxIDBlagajnaStavkaIsplataBindingSource)).EndInit();
			//((System.ComponentModel.ISupportInitialize)(this.uxIDDjelatnikBindingSource)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.uxPutniNalogErrorProvider)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.uxPutniNalogDataGridView)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.uxPutniNalogBindingSource)).EndInit();
			this.ResumeLayout(false);
		}
		#endregion
				
		#region events
		
		/// <summary>
		/// Raised the CurrentEntityChanged event.
		/// </summary>
		protected void OnCurrentEntityChanged()
		{
			if (CurrentEntityChanged != null)
			{
				PutniNalogDataGridViewEventArgs args = new PutniNalogDataGridViewEventArgs();
				args.PutniNalog = _currentPutniNalog;
				CurrentEntityChanged(this, args); 
			}
		}
		
		#endregion
		
		/// <summary>
		/// Strongly typed event 
		/// </summary>
		public class PutniNalogDataGridViewEventArgs : System.EventArgs
		{
			private Entities.PutniNalog	_PutniNalog;
	
			/// <summary>
			/// the  Entities.PutniNalog instance.
			/// </summary>
			public Entities.PutniNalog PutniNalog
			{
				get { return _PutniNalog; }
				set { _PutniNalog = value; }
			}	
		}
		
		/// <summary>
		/// Handles the DataError event of the uxPutniNalogDataGridView control.
		/// </summary>
		/// <param name="sender">The source of the event.</param>
		/// <param name="e">The <see cref="T:System.Windows.Forms.DataGridViewDataErrorEventArgs"/> instance containing the event data.</param>
		protected void OnPutniNalogDataGridViewDataError(object sender, System.Windows.Forms.DataGridViewDataErrorEventArgs e)
		{
			System.Diagnostics.Debug.WriteLine(string.Format( "{0}, {1}", e.ColumnIndex, e.RowIndex));
		}
		
		/// <summary>
		/// Handles the CellValueNeeded event of the uxPutniNalogDataGridView control.
		/// </summary>
		/// <param name="sender">The source of the event.</param>
		/// <param name="e">The <see cref="T:System.Windows.Forms.DataGridViewCellValueEventArgs"/> instance containing the event data.</param>
		protected void OnPutniNalogDataGridViewCellValueNeeded(object sender, System.Windows.Forms.DataGridViewCellValueEventArgs e)
		{
			switch(uxPutniNalogDataGridView.Columns[e.ColumnIndex].Name)
			{
					case "uxIDDataGridViewColumn":
						e.Value = PutniNalogList[e.RowIndex].ID;
						break;
					case "uxOznakaDataGridViewColumn":
						e.Value = PutniNalogList[e.RowIndex].Oznaka;
						break;
					case "uxIDDjelatnikDataGridViewColumn":
						e.Value = PutniNalogList[e.RowIndex].IDDjelatnik;
						break;
					case "uxDatumDataGridViewColumn":
						e.Value = PutniNalogList[e.RowIndex].Datum;
						break;
					case "uxDatumObracunaDataGridViewColumn":
						e.Value = PutniNalogList[e.RowIndex].DatumObracuna;
						break;
					case "uxOpisDataGridViewColumn":
						e.Value = PutniNalogList[e.RowIndex].Opis;
						break;
					case "uxIDStatusDataGridViewColumn":
						e.Value = PutniNalogList[e.RowIndex].IDStatus;
						break;
					case "uxIDBlagajnaStavkaIsplataDataGridViewColumn":
						e.Value = PutniNalogList[e.RowIndex].IDBlagajnaStavkaIsplata;
						break;
					case "uxIDBlagajnaStavkaStornoDataGridViewColumn":
						e.Value = PutniNalogList[e.RowIndex].IDBlagajnaStavkaStorno;
						break;
					case "uxPredvidenoTrajanjeDataGridViewColumn":
						e.Value = PutniNalogList[e.RowIndex].PredvidenoTrajanje;
						break;
					case "uxPredvidenoTrajanjeDanaDataGridViewColumn":
						e.Value = PutniNalogList[e.RowIndex].PredvidenoTrajanjeDana;
						break;
					case "uxNapomenaDataGridViewColumn":
						e.Value = PutniNalogList[e.RowIndex].Napomena;
						break;
					case "uxIDDjelatnikOdobrioDataGridViewColumn":
						e.Value = PutniNalogList[e.RowIndex].IDDjelatnikOdobrio;
						break;
					case "uxIzvjestajPutovanjaDataGridViewColumn":
						e.Value = PutniNalogList[e.RowIndex].IzvjestajPutovanja;
						break;
					case "uxIDDjelatnikLikvidiraoDataGridViewColumn":
						e.Value = PutniNalogList[e.RowIndex].IDDjelatnikLikvidirao;
						break;
					case "uxIDDjelatnikBlagajnaDataGridViewColumn":
						e.Value = PutniNalogList[e.RowIndex].IDDjelatnikBlagajna;
						break;
					case "uxRedBrDataGridViewColumn":
						e.Value = PutniNalogList[e.RowIndex].RedBr;
						break;
				default:
				break;
			}
		}
		
		/// <summary>
		/// Handles the CellValuePushed event of the uxPutniNalogDataGridView control.
		/// </summary>
		/// <param name="sender">The source of the event.</param>
		/// <param name="e">The <see cref="T:System.Windows.Forms.DataGridViewCellValueEventArgs"/> instance containing the event data.</param>
		protected void OnPutniNalogDataGridViewCellValuePushed(object sender, System.Windows.Forms.DataGridViewCellValueEventArgs e)
		{
			switch(uxPutniNalogDataGridView.Columns[e.ColumnIndex].Name)
			{
					case "uxIDDataGridViewColumn":
						PutniNalogList[e.RowIndex].ID = (System.Int32)e.Value;
						break;
					case "uxOznakaDataGridViewColumn":
						PutniNalogList[e.RowIndex].Oznaka = (System.String)e.Value;
						break;
					case "uxIDDjelatnikDataGridViewColumn":
						PutniNalogList[e.RowIndex].IDDjelatnik = (System.Int32)e.Value;
						break;
					case "uxDatumDataGridViewColumn":
						PutniNalogList[e.RowIndex].Datum = (System.DateTime)e.Value;
						break;
					case "uxDatumObracunaDataGridViewColumn":
						PutniNalogList[e.RowIndex].DatumObracuna = (System.DateTime?)e.Value;
						break;
					case "uxOpisDataGridViewColumn":
						PutniNalogList[e.RowIndex].Opis = (System.String)e.Value;
						break;
					case "uxIDStatusDataGridViewColumn":
						PutniNalogList[e.RowIndex].IDStatus = (System.Int32)e.Value;
						break;
					case "uxIDBlagajnaStavkaIsplataDataGridViewColumn":
						PutniNalogList[e.RowIndex].IDBlagajnaStavkaIsplata = (System.Int32?)e.Value;
						break;
					case "uxIDBlagajnaStavkaStornoDataGridViewColumn":
						PutniNalogList[e.RowIndex].IDBlagajnaStavkaStorno = (System.Int32?)e.Value;
						break;
					case "uxPredvidenoTrajanjeDataGridViewColumn":
						PutniNalogList[e.RowIndex].PredvidenoTrajanje = (System.String)e.Value;
						break;
					case "uxPredvidenoTrajanjeDanaDataGridViewColumn":
						PutniNalogList[e.RowIndex].PredvidenoTrajanjeDana = (System.Decimal?)e.Value;
						break;
					case "uxNapomenaDataGridViewColumn":
						PutniNalogList[e.RowIndex].Napomena = (System.String)e.Value;
						break;
					case "uxIDDjelatnikOdobrioDataGridViewColumn":
						PutniNalogList[e.RowIndex].IDDjelatnikOdobrio = (System.Int32?)e.Value;
						break;
					case "uxIzvjestajPutovanjaDataGridViewColumn":
						PutniNalogList[e.RowIndex].IzvjestajPutovanja = (System.String)e.Value;
						break;
					case "uxIDDjelatnikLikvidiraoDataGridViewColumn":
						PutniNalogList[e.RowIndex].IDDjelatnikLikvidirao = (System.Int32?)e.Value;
						break;
					case "uxIDDjelatnikBlagajnaDataGridViewColumn":
						PutniNalogList[e.RowIndex].IDDjelatnikBlagajna = (System.Int32?)e.Value;
						break;
					case "uxRedBrDataGridViewColumn":
						PutniNalogList[e.RowIndex].RedBr = (System.Int32?)e.Value;
						break;
				default:
				break;
			}
		}
	}
}
